from tkinter import Tk, Canvas
from PIL import Image, ImageTk

import numpy as np


class App:
    def __init__(self, root):
        self.root = root
        self.canvas = Canvas(root)
        self.canvas.pack()
        image = Image.fromarray(np.ones((20, 20, 3), dtype=np.uint8) * 0)
        self.img = ImageTk.PhotoImage(image)
        self.canvas.create_image(20, 20, anchor='nw', image=self.img)

root = Tk()
app = App(root)
root.mainloop()
